﻿using System;
using System.Custom.Generic;
using System.Drawing;
using Gizmox.WebGUI.Forms;

namespace CoCoon.Forms
{
    public class RibbonBarColorComboBoxItem : RibbonBarComboBoxItem
    {
        public Color Color
        {
            get
            {
                if (ComboBox.SelectedValue != null)
                    return (Color)ComboBox.SelectedValue;
                return Color.White;
            }
            set
            {
                ComboBox.SelectedValue = value;
            }
        }

        protected override Control CreateControl()
        {
            WebColorComboBox = new WebColorComboBox();
            return WebColorComboBox;
        }

        public WebColorComboBox WebColorComboBox { get ; set; }

        public RibbonBarColorComboBoxItem OnSelectedColorChanged(EventHandler<EventArgs<Color>> handler)
        {
            this.WebColorComboBox.SelectedColorChanged += handler;
            return this;
        }
    }
}